package com.kaifamiao.ioc.autowire;

public class UserService {

    private UserDao dao;

    public UserService() {
        super();
    }

    public UserService(UserDao dao) {
        System.out.println( "UserService( UserDao )" );
        this.dao = dao;
    }

    public boolean save(String user ) {
        System.out.println( "user service : save" );
        return dao.persist( user );
    }

    public UserDao getUserDao() {
        return dao;
    }

    public void setUserDao(UserDao userDao) {
        this.dao = userDao;
    }
}
